/*
 * @Author: vera_min vera_min@163.com
 * @Date: 2025-07-03 16:49:01
 * @LastEditors: vera_min vera_min@163.com
 * @LastEditTime: 2025-07-17 21:51:37
 * @FilePath: /mail_project_destop/src/components/elementPlus.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { App } from "vue";
import { ElButton, ElPopover, ElInput, ElSelect, ElDialog, ElCascader,
    ElUpload, ElMain, ElConfigProvider, ElScrollbar, ElOption, ElFormItem,
    ElForm, ElLoadingDirective, ElInfiniteScroll, ElTable, ElTableColumn, ElPagination,
    ElDatePicker, ElRow, ElCol, ElDropdown, ElDropdownItem, ElDropdownMenu, ElColorPicker, ElTag, ElCheckbox, ElRadioGroup, ElRadio, ElCard } from 'element-plus';
    
import 'element-plus/es/components/button/style/css';
import 'element-plus/es/components/popover/style/css';
import 'element-plus/es/components/input/style/css';
import 'element-plus/es/components/select/style/css';
import 'element-plus/es/components/dialog/style/css';
import 'element-plus/es/components/cascader/style/css';
import 'element-plus/es/components/upload/style/css';
import 'element-plus/es/components/main/style/css';
import 'element-plus/es/components/config-provider/style/css';
import 'element-plus/es/components/scrollbar/style/css';
import 'element-plus/es/components/form-item/style/css';
import 'element-plus/es/components/form/style/css';
import 'element-plus/es/components/loading/style/css';
import 'element-plus/es/components/message/style/css';
import 'element-plus/es/components/message-box/style/css';
import 'element-plus/es/components/notification/style/css';
import 'element-plus/es/components/infinite-scroll/style/index';
import 'element-plus/es/components/table/style/index';
import 'element-plus/es/components/table-column/style/index';
import 'element-plus/es/components/pagination/style/index';
import 'element-plus/es/components/date-picker/style/index';
import 'element-plus/es/components/row/style/index';
import 'element-plus/es/components/col/style/index';
import 'element-plus/es/components/dropdown/style/index';
import 'element-plus/es/components/dropdown-item/style/index';
import 'element-plus/es/components/dropdown-menu/style/index';
import 'element-plus/es/components/color-picker/style/index';
import 'element-plus/es/components/tag/style/index';
import 'element-plus/es/components/checkbox/style/index';
import 'element-plus/es/components/radio-group/style/index';
import 'element-plus/es/components/radio/style/index';
import 'element-plus/es/components/card/style/index';

export const initElementPlus = (app: App) => {
  // 修改默认值
  ElDialog.props.closeOnClickModal.default = false;

  // 注册所需的组件
  app.component('ElButton', ElButton);
  app.component('ElPopover', ElPopover);
  app.component('ElInput', ElInput);
  app.component('ElSelect', ElSelect);
  app.component('ElDialog', ElDialog);
  app.component('ElCascader', ElCascader);
  app.component('ElUpload', ElUpload);
  app.component('ElMain', ElMain);
  app.component('ElConfigProvider', ElConfigProvider);
  app.component('ElScrollbar', ElScrollbar);
  app.component('ElOption', ElOption);
  app.component('ElFormItem', ElFormItem);
  app.component('ElForm', ElForm);
  app.component('ElTable', ElTable);
  app.component('ElTableColumn', ElTableColumn);
  app.component('ElPagination', ElPagination);
  app.component('ElDatePicker', ElDatePicker);
  app.component('ElRow', ElRow);
  app.component('ElCol', ElCol);
  app.component('ElDropdown', ElDropdown);
  app.component('ElDropdownItem', ElDropdownItem);
  app.component('ElDropdownMenu', ElDropdownMenu);
  app.component('ElColorPicker', ElColorPicker);
  app.component('ElTag', ElTag);
  app.component('ElCheckbox', ElCheckbox);
  app.component('ElRadioGroup', ElRadioGroup);
  app.component('ElRadio', ElRadio);
  app.component('ElCard', ElCard);  
  
  app.directive('loading', ElLoadingDirective);
  app.directive('infiniteScroll', ElInfiniteScroll);
};
